<template>
  <div class="layui-layout layui-layout-admin">
    <div class="adminnav1">
      <Pagetop></Pagetop>
    </div>
    <div class="adminnav2">
      <Secondnav urlname="homepage"></Secondnav>
    </div>
    <!-- 主体内容 -->
    <div class="layui-body kedou-admin" id="LAY_app_body app">
      <div class="layadmin-tabsbody-item layui-show">
        <div class="pagelist">
          <div class="layui-card-body">
            <fieldset class="layui-elem-field layui-field-title">
              <legend>提现设置</legend>
            </fieldset>
          </div>

          <div class="layui-card-body cardbody">
            <div class="layui-form" lay-filter="">
              <div class="layui-form-item">
                <label class="layui-form-label">积分提现比例：</label>
                <div class="layui-input-block">
                  <input type="text" name="title" autocomplete="off" v-model='itemData.balanceCreditRmbRatio' placeholder="请输入" class="layui-input">
                </div>
                <div class="layui-form-mid layui-word-aux" style="margin-left: 150px;">% (积分提现比例为10,即10%;如提现100积分，可获得100*0.1=1元钱;自动存进资金账户) </div>
              </div>
              
              <div class="layui-form-item">
                <label class="layui-form-label">共享金提现比例：</label>
                <div class="layui-input-block">
                  <input type="text" name="title" autocomplete="off" v-model='itemData.balanceGxjRatio' placeholder="请输入" class="layui-input">
                </div>
                <div class="layui-form-mid layui-word-aux" style="margin-left: 150px;">% (共享金提现比例为100,即100%;如提现100共享金，可获得100*1=100元;自动存进资金账户) </div>
              </div>

              <div class="layui-form-item">
                <label class="layui-form-label">现金提现比例：</label>
                <div class="layui-input-block">
                  <input type="text" name="title" autocomplete="off" v-model='itemData.balanceRmbRatio' placeholder="请输入" class="layui-input">
                </div>
                <div class="layui-form-mid layui-word-aux" style="margin-left: 150px;">% (现金提现比例为100,即100%;如提现100现金，可获得100*1=100元;自动存进资金账户) </div>
              </div>

              <div class="layui-form-item">
                <label class="layui-form-label">第三方提现手续费：</label>
                <div class="layui-input-block">
                  <input type="text" name="title" autocomplete="off" v-model='itemData.brokerage' placeholder="请输入" class="layui-input">
                </div>
                <div class="layui-form-mid layui-word-aux" style="margin-left: 150px;">‰ (千分比)微信等，如提现100元，手续费比例为1‰，即收取100*1‰=0.1元手续费;手续费从用户剩余资金扣除，资金不足于支付手续费则不予提现。 </div>
              </div>
							<div class="layui-form-item">
                <label class="layui-form-label">现金提现手续费：</label>
                <div class="layui-input-block">
                  <input type="text" name="title" autocomplete="off" v-model='itemData.rmbBrokerage' placeholder="请输入" class="layui-input">
                </div>
                <div class="layui-form-mid layui-word-aux" style="margin-left: 150px;">‰ (千分比)，如提现100元，手续费比例为1‰，即收取100*1‰=0.1元手续费;手续费从用户剩余资金扣除，资金不足于支付手续费则不予提现。 </div>
              </div>
              <div class="layui-form-item">
                <label class="layui-form-label">共享提现手续费：</label>
                <div class="layui-input-block">
                  <input type="text" name="title" autocomplete="off" v-model='itemData.gxjBrokerage' placeholder="请输入" class="layui-input">
                </div>
                <div class="layui-form-mid layui-word-aux" style="margin-left: 150px;">‰ (千分比)，如提现100元，手续费比例为1‰，即收取100*1‰=0.1元手续费;手续费从用户剩余资金扣除，资金不足于支付手续费则不予提现。 </div>
              </div>
              

              <div class="layui-form-item">
                <div class="layui-input-block">
                  <button type="submit" class="layui-btn" @click="save">保存</button>
                </div>
              </div>

            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>
<script>
import Pagetop from "../common/pagetop.vue";
import Secondnav from "../common/secondnav.vue";
export default {
  name: "shopset",
  components: { Pagetop, Secondnav },
  data () {
    return {
			itemData:{
				balanceCreditRmbRatio:'',
				balanceGxjRatio:'',
				balanceRmbRatio:'',
				brokerage:'',
				rmbBrokerage:'',
				gxjBrokerage:''
			}
    };
  },
  mounted () {
    this.getdate()
  },
  methods: {
  	getdate:function(){
  		var url='/pay/aapi/v1.9/withdrawal-setting/1'
  		var _this=this;
  		ajaxRequest(url,'GET','json','',function(ret,err){
				 _this.itemData=ret.data;
			})	
  	},
  	save:function(){
  		var url='/pay/aapi/v1.9/withdrawal-setting'
  		var dates={
			  "balanceCreditRmbRatio":this.itemData.balanceCreditRmbRatio,
			  "balanceGxjRatio":this.itemData.balanceGxjRatio,
			  "balanceRmbRatio":this.itemData.balanceRmbRatio,
			  "brokerage": this.itemData.brokerage,
			  "gxjBrokerage":this.itemData.gxjBrokerage,
			  "rmbBrokerage":this.itemData.rmbBrokerage,
			  "id": "1"
			}
  		var _this=this;
  		ajaxRequest(url,'POST','json',dates,function(ret,err){
				 layer.msg("设置成功");
				 _this.getdate()
			})
  	}
  },
  updated: function () {
	  layui.use("form", function () {
	    var form = layui.form;
	    form.render();
	  })
	}
};
</script>
<style scoped>
.layui-form-label {
  width: 120px;
}
.layui-input-block {
  margin-left: 150px;
  width: 220px;
}
/*二级导航*/
</style>